/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package entity;

import org.hibernate.Criteria;
import org.orm.PersistentException;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class MediaCriteria extends AbstractORMCriteria {
	public final IntegerExpression ID;
	public final StringExpression nome;
	public final LongExpression data;
	public final FloatExpression dimensione;
	public final StringExpression url;
	public final StringExpression discriminator;
	
	public MediaCriteria(Criteria criteria) {
		super(criteria);
		ID = new IntegerExpression("ID", this);
		nome = new StringExpression("nome", this);
		data = new LongExpression("data", this);
		dimensione = new FloatExpression("dimensione", this);
		url = new StringExpression("url", this);
		discriminator = new StringExpression("discriminator", this);
	}
	
	public MediaCriteria(PersistentSession session) {
		this(session.createCriteria(Media.class));
	}
	
	public MediaCriteria() throws PersistentException {
		this(entity.CaranonnaPersistentManager.instance().getSession());
	}
	
	public AlbumCriteria createAlbumCriteria() {
		return new AlbumCriteria(createCriteria("album"));
	}
	
	public MessaggioCriteria createMessaggioCriteria() {
		return new MessaggioCriteria(createCriteria("ORM_Messaggio"));
	}
	
	public Media uniqueMedia() {
		return (Media) super.uniqueResult();
	}
	
	public Media[] listMedia() {
		java.util.List list = super.list();
		return (Media[]) list.toArray(new Media[list.size()]);
	}
}

